package com.xiyou.luckdraw.api.dto.answer;

import com.xiyou.luckdraw.common.constants.ResultCodeConstants;
import com.xiyou.luckdraw.common.exception.ValidateException;
import com.xiyou.luckdraw.common.result.AbstractRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @ClassName: AnswerBankListRequest
 * @Description:
 * @author: limingxing
 * @Date: 2019-10-09 15:40
 */
@Data
@ApiModel("Excel导入答题列表请求")
public class ExcelAnswerListRequest extends AbstractRequest {

    @ApiModelProperty(value="题目列表")
    private List<AnswerBankDto> saveList;

    @Override
    public void requestCheck() {
        if (null == saveList || saveList.isEmpty()) {
            throw new ValidateException(ResultCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getCode(), ResultCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }

    }
}
